A Hitchhiker's Guide to Reinventing a Prolog Machine

نویسنده

  • Paul Tarau
چکیده

We take a fresh, “clean-room” look at implementing Prolog by deriving its translation to an executable representation and its execution algorithm from a simple Horn Clause meta-interpreter. The resulting design has some interesting properties: • the heap representation of terms and the abstract machine instruction encodings are the same • no dedicated code area is used as the code is placed directly on the heap • unification and indexing operations are orthogonal • filtering of matching clauses happens without building new structures on the heap • variables in function and predicate symbol positions are handled with no performance penalty • a simple English-like syntax is used as an intermediate representation for clauses and goals • the same English-like syntax can be used by programmers directly as an alternative to classic Prolog syntax • solutions of (multiple) logic engines are exposed as answer streams that can be combined through typical functional programming patterns • performance of a basic interpreter implementing our design is within a factor of 2 of a highly optimized WAM-based system To help placing our design on the fairly rich map of Prolog systems, we discuss similarities to existing Prolog abstract machines, with emphasis on separating necessary commonalities from arbitrary implementation choices.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

The Virtual Flute: An Advanced Fingering Guide Generated Via Machine Intelligence

The Virtual Flute is a web service that provides many thousands of machine-predicted alternative fingerings. Alternative fingerings can offer variations in intonation and timbre, and can be easier to play in different musical contexts. Many play multiphonics. An advanced fingering guide is invaluable when exotic effects and demanding passages are required of the player. The Virtual Flute uses a...

متن کامل

TR-2003014: A High-Performance Abstract Machine for Prolog and Its Extensions

This paper describes the design and the implementation of the TOAM (Tree-Oriented Abstract Machine) for Prolog and its extensions. The TOAM, as a Prolog machine, is based on the famous WAM model but differs from it in argument passing, stack management, and clause indexing. The original TOAM for Prolog was designed over ten years ago and the architecture was published in ACM TOPLAS in 1996 [26]...

متن کامل

SWI - Prolog 5 . 10 Reference Manual

SWI-Prolog is a Prolog implementation based on a subset of the WAM (Warren Abstract Machine). SWI-Prolog was developed as an open Prolog environment, providing a powerful and bi-directional interface to C in an era this was unknown to other Prolog implementations. This environment is required to deal with XPCE, an object-oriented GUI system developed at SWI. XPCE is used at SWI for the developm...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2017